<template>
  <div>
    <van-nav-bar
      title="账号管理"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
    <div>
     <van-cell title="手机号" is-link to="phonenumber" :value="this.phonenumber" />
    </div>
    <div>
     <van-cell title="修改密码" is-link to="changepassword" />
    </div>
    <div>
      <van-cell title="班级" is-link to="unitsetting" :value="this.u_class" />
    </div>
    <div>
      <van-cell title="实名认证" is-link to="realname"  :value="this.name" />
    </div>
    <div class="shanchu">
      <van-cell title="账号注销" is-link to="cancelaccount" />
    </div>
  </div>
</template>
<script>
import Vue from "vue";
import { NavBar } from "vant";
import { Toast } from "vant";
import { Cell, CellGroup } from "vant";

Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(NavBar);
export default {
  name: "mamagement",
  data(){
      return {
        phonenumber:"",
        unitsetting:'',
        name:'',
        u_class:''
      }
  },
  mounted() {
     let user_id=localStorage.getItem("userId")
     this.axios({
       url:"http://localhost:3000/query_data",
       method:"post",
       data:{
         userID:user_id
       }
     }).then((res)=>{
       console.log(res)
      this.phonenumber=res.data[0].cell_phone
      this.unitsetting=res.data[0].company
      this.name=res.data[0].user_name
      this.u_class=res.data[0].u_class


      //  console.log(res.data[0])
      //  localStorage.setItem("person_data",res.data[0])
      //  this.url_img=res.data[0].head_img
      //  this.sex_num=res.data[0].sex
      //  this.autograph=res.data[0].signature
      //  this.name=res.data[0].user_name

     })
  },
  methods: {
    onClickLeft() {
      this.$router.push("compilation")
    },
    onClickRight() {
      Toast("按钮");
    },
  },
};
</script>
<style scoped>
/deep/.van-nav-bar__text {
  color: black;
}
/deep/.van-icon {
  color: black;
}
.van-cell__title {
  text-align: left;
}
.van-cell{
    border-top: 3px solid rgb(247, 243, 243);
}
.shanchu .van-cell{

    border-top: 10px solid rgb(247, 244, 244);
}
</style>